package com.example.forum.exception;

import com.example.forum.common.AppResult;

public class ApplicationException extends RuntimeException{
    //自定义错误
    private AppResult errorResult;
    //显示自定义错误
    public ApplicationException(AppResult errorResult){
        super(errorResult.getMessage());
        this.errorResult = errorResult;
    }

    public AppResult getErrorResult() {
        return errorResult;
    }

    public ApplicationException(String message) {
        super(message);
    }

    public ApplicationException(String message, Throwable cause) {
        super(message, cause);
    }

    public ApplicationException(Throwable cause) {
        super(cause);
    }
}
